{{ $jdkversions := $.Site.Data.jdk.versions }}

<ul>

<li>All JDK versions have valid status.</li>
<ul>
{{ range $jdkversions }}
  {{ if not (index $.Site.Data.jdk.status .status) }}{{ errorf "Unknown Status %s" .status }}{{ end }}
  <li>{{ .version }} / {{ .status }} &check;</li>
{{ end }}
</ul>

<li>All products of all vendors have valid JDK version references.</li>
<ul>
{{ range $.Page.Site.Data.jdk.vendors }}
  {{ $vendorname := .name }}
  {{ range .products }}
    {{ range .versions }}
      {{ if not (index $jdkversions .) }}{{ errorf "Unknown JDK %s" . }}{{ end }}
    {{ end }}
    <li>{{ $vendorname}} / {{ .name }} &check;</li>
  {{ end }}
{{ end }}
</ul>

<li>All JDK features have valid categories.</li>
<ul>
{{ range $jdkversions }}
  {{ range .features }}
    {{ if not (index $.Page.Site.Data.jdk.featurecategories .category) }}{{ errorf "Unknown category %s" .category }}{{ end }}
    <li>{{ .title }} &check;</li>
  {{ end }}
{{ end }}
</ul>

<li>All JDK incubator and preview features must have a revision.</li>
<ul>
{{ range $jdkversions }}
  {{ range .features }}
    {{ if and (or .incubator .preview) (not .revision) }}{{ errorf "Preview without revision: %s" .title }}{{ end }}
    <li>{{ .title }} &check;</li>
  {{ end }}
{{ end }}
</ul>


<li>All JDK features have valid Java Almanac links.</li>
<ul>
{{ range $jdkversions }}
  {{ range .features }}
    {{ range .refs }}
      {{ if eq .type "AlmanacFeature" }}
        {{ if not ($.Site.Home.GetPage (printf "/features/%s" .identifier)) }}
          {{ errorf "Invalid Java Almanac feature %s" .identifier }}
        {{ end }}
        <li>{{ .identifier }} &check;</li>
      {{ end }}
    {{ end }}
  {{ end }}
{{ end }}
</ul>

<li>All API diffs have valid JDK version references.</li>
<ul>
{{ range $jdkversions }}
  {{ range .apidiff }}
    {{ if not (index $jdkversions .base.feature) }}{{ errorf "Unknown JDK %s" .base.feature }}{{ end }}
    {{ if not (index $jdkversions .target.feature) }}{{ errorf "Unknown JDK %s" .target.feature }}{{ end }}
    <li>{{ .base.version }} / {{ .target.version }} &check;</li>
  {{ end }}
{{ end }}
</ul>

<li>All bytecode opcodes have valid categories.</li>
<ul>
{{ range $.Page.Site.Data.bytecode.opcodes }}
  {{ if not (index $.Page.Site.Data.bytecode.categories .category) }}{{ errorf "Unknown category %s" .category }}{{ end }}
  <li>{{ .mnemonic }} is {{ .category }} &check;</li>
{{ end }}
</ul>

</ul>